package com.wangxiaotao.springcloud.alibaba.controller;

import com.wangxiaotao.springcloud.alibaba.entity.CommonResult;
import com.wangxiaotao.springcloud.alibaba.entity.Order;
import com.wangxiaotao.springcloud.alibaba.service.OrderService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Slf4j
@RequiredArgsConstructor
public class OrderController {
    private final OrderService orderService;

    @GetMapping(value = "/order/create")
    public CommonResult create(Order order){
        orderService.create(order);
        return new CommonResult(200,"订单创建成功");
    }

}
